package com.controller;/**
 * @Deacription TODO
 * @Author baohuajie
 * @Date 2020/12/13 23:01
 * @Version 1.0
 **/

import com.alibaba.fastjson.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 *@Deacription TODO
 *@Author baohuajie
 *@Date 2020/12/13 23:01
 *@Version 1.0
 **/
@RestController
@RequestMapping("/query")
public class HystrixController {
    private final Logger logger = LoggerFactory.getLogger(HystrixController.class);

    @RequestMapping(value = "/querySingle", method = {RequestMethod.POST, RequestMethod.GET})
    public String querySingle(@RequestBody String param) {

        JSONObject jsonObject = JSONObject.parseObject(param, JSONObject.class);
        String id = jsonObject.getString("id");
        String result = "user" + id;

        return result;
    }
}
